<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%String path = request.getContextPath();%>
<form id="pagerForm" method="post" action="<%=path %>/sendMsg/listSendMsg.action">
	<input type="hidden" name="pageRequest" value="1" />
	<input type="hidden" name="pageNum" value="${paginator.pageIndex}" />
	<input type="hidden" name="numPerPage" value="${paginator.pageSize}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm" action="<%=path %>/sendMsg/listSendMsg.action" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label style="text-align: right;">手机号码：</label>
				<input type="text" name="sendMsgVO.mobile" value="<s:property value="sendMsgVO.mobile" />" />
			</li>
			<li>
				<label style="text-align: right;">内容：</label>
				<input type="text" name="sendMsgVO.content" value="<s:property value="sendMsgVO.content" />" />
			</li>
			<li>
				<label style="text-align: right;">模板：</label>
				<select name="sendMsgVO.template.id" class="combox">
					<option value="-1">选择模板</option>
					<c:forEach var="item" items="${templates}">
						<option value="${item.id}" ${sendMsgVO.template.id eq item.id ? "selected" : "-1" }>${item.name}</option>
					</c:forEach>
				</select>
			</li>
		</ul>
		<ul class="searchContent">
			<li>
				<label style="text-align: right;">状态：</label>
				<select name="sendMsgVO.status" class="combox">
					<option value="">选择状态</option>
					<c:forEach var="item" items="${statuses}">
						<option value="${item.name}" ${sendMsgVO.status eq item.name ? "selected" : ""}>${item.title}</option>
					</c:forEach>
				</select>
			</li>
			<li>
				<label style="text-align: right;">会员卡：</label>
				<input name="sendMsgVO.users" value="${messageVO.users}" type="hidden" class="param">
				<input style="cursor: pointer;float: left;" onclick="$('#sendMsgList_a_btnLook').click();" name="sendMsgVO.schemeCode" value="<s:property value="sendMsgVO.schemeCode" />" class="param"/>
				<!-- <a class="btnLook" id="sendMsgList_a_btnLook" href="<%=path%>/memberCard/listMemberCard.action?searchType=message" lookupGroup="sendMsgVO">选择</a> -->
			</li>
			<li style="width:450px">
				<label style="text-align: right;">发送时间：</label>
				从<input type="text" name="sendMsgVO.gtsendTime" value="${sendMsgVO.gtsendTimeStr}" dateFmt="yyyy-MM-dd HH:mm:ss" class="date" readonly="readonly" size="19"/>
				到<input type="text" name="sendMsgVO.ltsendTime" value="${sendMsgVO.ltsendTimeStr}"  dateFmt="yyyy-MM-dd HH:mm:ss" class="date" readonly="readonly" size="19"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<!-- <li><a class="add" href="<%=path %>/sendMsg/addSendMsg.action" target="navTab"><span>添加</span></a></li> -->
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" postType="string" href="<%=path %>/sendMsg/deleteSendMsg.action" class="delete"><span>删除</span></a></li>
			<li><a class="edit" href="<%=path %>/sendMsg/editSendMsg.action?sendMsgVO.id={sid_user}" target="navTab" warn="请选择一条记录"><span>修改</span></a></li>
		</ul>
	</div>
	<table class="table" width="1150" layoutH="164">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<!--  <th>标题</th>
				<th>类型</th>-->
				<th>会员卡</th>
				<th>手机号码</th>
				<th>发送时间</th>
				<!--  <th>周期</th>-->
				<th>类型</th>
				<th>状态</th>
				<th>模板</th>
				<th>内容</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="sendMsgList" id="sendMsg" status="st">
				<tr target="sid_user" rel="<s:property value="id" />">
					<td><input name="ids" value="<s:property value="id" />" type="checkbox"></td>
             <!--<td><s:property value="title" /></td>	
             <td><s:property value="msgType" /></td>-->	
             <td><s:property value="schemeCode" /></td>	
             <td><s:property value="mobile" /></td>	
			<td><s:date name="sendTime" format="yyyy-MM-dd HH:mm:ss" /></td>
			<td><s:property value="template.targetTypeTitle" /></td>
             <!--<td><s:property value="scheduleType" /></td>-->
             <td>
				<c:choose>
		             	<c:when test="${'SENDED'==status}">已发送</c:when>  
		             	<c:when test="${'SENDING'==status}">正在发送</c:when>  
   						 <c:otherwise>未发送</c:otherwise>  
				</c:choose>  
			</td>
             <td><s:property value="template.name" /></td>
             <td><s:property value="content" /></td>	
					<td>
						<a title="确实要删除这条记录吗?" target="ajaxTodo" href="<%=path %>/sendMsg/deleteSendMsg.action?ids=<s:property value="id" />" class="btnDel">删除</a>
						<a title="编辑" target="navTab" href="<%=path %>/sendMsg/editSendMsg.action?sendMsgVO.id=<s:property value="id" />" class="btnEdit">编辑</a>
						<a title="查看" target="navTab" href="<%=path %>/sendMsg/viewSendMsg.action?sendMsgVO.id=<s:property value="id" />" class="btnView">查看</a>
					</td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
				<span>显示</span>
				<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
					<option value="15" <c:if test="${paginator.pageSize==15}">selected='selected'</c:if> >15</option>
					<option value="30" <c:if test="${paginator.pageSize==30}">selected='selected'</c:if> >30</option>
					<option value="50" <c:if test="${paginator.pageSize==50}">selected='selected'</c:if> >50</option>
					<option value="100" <c:if test="${paginator.pageSize==100}">selected='selected'</c:if> >100</option>
					<option value="200" <c:if test="${paginator.pageSize==200}">selected='selected'</c:if> >200</option>
				</select>
				<span>条，共${paginator.totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab" totalCount="${paginator.totalCount}" 
				numPerPage="${paginator.pageSize}" pageNumShown="10" currentPage="${paginator.pageIndex}"></div>

	</div>
</div>